package com.example.multitenant.multitenant.config

import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

/**
 * @author xiang
 * @Date 2022/8/23 12:02
 **/

@Configuration
class WebConfig(private val tenantInterceptor: TenantInterceptor): WebMvcConfigurer {

    override fun addInterceptors(registry: InterceptorRegistry) {
        registry.addWebRequestInterceptor(tenantInterceptor)
    }

}